package edu.fzu.shop.service.Impl;

import java.util.List;

import edu.fzu.shop.bean.GoodsBean;
import edu.fzu.shop.dao.GoodsDao;
import edu.fzu.shop.dao.Impl.GoodsDaoJDBCImpl;
import edu.fzu.shop.service.GoodsService;

public class GoodsServiceImpl implements GoodsService {

	public GoodsBean getGoodsByCode(String goodsCode) {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		return goodsDao.getGoodsByCode(goodsCode);
	}

	public byte[] getGoodsPic(String goodsCode) {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		return goodsDao.getGoodsPic(goodsCode);
	}

	public List<GoodsBean> loadAll() {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		return goodsDao.loadAll();
	}

	public void remove(String goodsCode) {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		goodsDao.delete(goodsCode);

	}

	public void save(GoodsBean goodsBean) {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		goodsDao.add(goodsBean);

	}

	public void update(GoodsBean goodsBean) {
		GoodsDao goodsDao = new GoodsDaoJDBCImpl();
		goodsDao.update(goodsBean);

	}

}
